package com.squirrel.michale;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/2/23 8:16 PM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class DataStream {
    int value;
    int k;
    int diffPosition;
    public DataStream(int value, int k) {
        this.value = value;
        this.k = k;
    }

    public boolean consec(int num) {
        if (num != value) {
            diffPosition = 0;
        }else {
            diffPosition++;
        }
        return diffPosition >= k;
    }
}
